//起始引入的vue-router提供路由数组的ts类型
import type { RouteRecordRaw } from 'vue-router';
//meta中的showTabBar控制tabbar的显示与隐藏
export const routes: Array<RouteRecordRaw> = [
  //首页
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: () => import('../views/home/index.vue'),
    name:'home',
    meta: {
      showTabBar: true
    },
  },
  {
    path: '/list',
    component: () => import('../views/home/homeCategory.vue')
  },
  {
    path: '/ucenter',
    component: () => import('../views/ucenter/index.vue')
  },
  {
    path: '/login',
    component: () => import('../views/login/index.vue'),

  },
  {
    path: '/register',
    component: () => import('../views/register/index.vue')
  },
  {
    path: '/cart',
    component: () => import('../views/cart/index.vue'),
    meta: {
      showTabBar: true
    }
  },
  //提交订单页
  {
    path: '/submitorde',
    component: () => import('../views/submit_order/index.vue'),
  },
  //交易页
  {
    path: '/trade',
    component: () => import('../views/trade/index.vue'),
  },
  {
    path: '/search',
    component: () => import('../views/search/index.vue'),
    name: 'search',
  },
  {
    path: '/category',
    component: () => import('../views/category/index.vue'),
    meta: {
      showTabBar: true
    }
  },
  {
    path: '/particulars',
    component: () => import('../views/particulars/index.vue')

  },
  {
    path: '/pay',
    component: () => import('../views/pay/index.vue'),
    meta: {
      showTabBar: true
    }
  },
  //匹配任意路由要写在最后
  {
    path: '/:pathMatch(.*)',
    redirect: '/home'
  }

]